package com.ykl.base.jpa;

import org.hibernate.criterion.Order;
import org.springframework.data.domain.Sort;

import java.util.List;
import java.util.Optional;

public interface BasicEntityOptions<T> {
    T save(T entity);

    List<T> save(Iterable<T> entities);

    void deleteById(String id);

    void delete(T entity);

    void delete(Iterable<T> entities);

    void deleteByIds(Iterable<String> ids);

    Optional<T> findById(String id);

    List<T> listAll(Sort sort);

    List<T> listAll();
}
